home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / lisp / clue.lha / clue / doc / clue.tex / node83_mn.html < prev    next >
Text File  |  1989-07-12  |  4KB  |  81 lines

  1.  
  2. <H3><A ID="SECTION002611100000000000000"><tex2html_anchor_invisible_mark></A> <A ID="ch:creation"><tex2html_anchor_mark></A><BR>
  3. Contact Creation
  4. </H3><#4896#>
  5.            
  6.       
  7.  
  8.  
  9. <P>
  10. The creation of a contact object is actually a two-step process, in which a
  11. contact instance is first <#327#><B>initialized</B><#327#><A ID="328"><tex2html_anchor_invisible_mark></A> and 
  12. then <#329#><B>realized</B><#329#><A ID="330"><tex2html_anchor_invisible_mark></A><A ID="331"><tex2html_anchor_invisible_mark></A>. Initialization consists
  13. of collecting initial values for all contact attributes. However, no X server
  14. <A ID="332"><tex2html_anchor_invisible_mark></A> resources (windows, etc.) are actually
  15. allocated.  Later, when the contact is realized,
  16. these resources are allocated and contact creation is complete. Postponing
  17. server resource allocation until realization can make the process of creating a
  18. new contact much more efficient. It is common for server resources to be
  19. affected by operations that occur after initialization but before the contact is
  20. actually displayed to the user. For example, when creating a complex contact
  21. hierarchy, the addition of descendants can modify the size of ancestor contact
  22. windows (see Chapter~<A HREF=<tex2html_cr_mark>#ch:contact-hierarchy#333><tex2html_cr_mark></A> for a discussion of composite
  23. contacts and geometry management). In this case, realization of the composite
  24. contact would occur after the initialization of all of its descendants and would
  25. allocate a window using the final adjusted size.
  26.  
  27. <P>
  28. Initialization of a new
  29. contact object is performed by the <#334#><TT>make-contact</TT><#334#> function.
  30. <A ID="335"><tex2html_anchor_invisible_mark></A> 
  31. Many initial attributes of a contact are considered to be
  32. resources<A ID="336"><tex2html_anchor_invisible_mark></A> that can be read from a resource database
  33. (see Chapter~<A HREF=<tex2html_cr_mark>#ch:resource-management#337><tex2html_cr_mark></A>).
  34. Contact resources are described in the resource specification list given in the
  35. <#338#><TT>defcontact</TT><#338#> form defining a contact class (see
  36. Section~<A HREF=<tex2html_cr_mark>#ch:defcontact#339><tex2html_cr_mark></A>).  <A ID="340"><tex2html_anchor_invisible_mark></A>
  37. For example, the resource specification list for the <#341#><TT>contact</TT><#341#> class allows values for
  38. certain slots, for window creation attributes, and for other
  39. attributes to be read from a resource database during contact
  40. initialization.
  41. The <#342#><TT>make-contact</TT><#342#> function implements most of the resource processing done during
  42. contact initialization<A NAME="tex2html36" HREF="#footfnm1" TARGET="footer"><SUP>23.1</SUP></A>. 
  43.  
  44. <P>
  45. Typically, CLUE programmers need not be aware of contact realization.  CLUE
  46. realizes a contact automatically by calling the <#347#><TT>realize</TT><#347#>
  47. function<A ID="348"><tex2html_anchor_invisible_mark></A> during the next call to <#349#><TT>process-next-event</TT><#349#><A ID="350"><tex2html_anchor_invisible_mark></A> after initialization.
  48. However, there are cases when it is useful to invoke the <#351#><TT>update-state</TT><#351#><A ID="352"><tex2html_anchor_invisible_mark></A> function to cause realization
  49. explicitly (see Section~<A HREF=<tex2html_cr_mark>#ch:contact-state#353><tex2html_cr_mark></A>).  Contact programmers can use
  50. the <#354#><TT>realized-p</TT><#354#> method<A ID="355"><tex2html_anchor_invisible_mark></A> to ensure that operations
  51. which depend on the existence of contact server resources are not performed
  52. before the contact has been realized.  For example, graphics output to a contact
  53. cannot occur before it is realized, because its window does not yet exist.
  54.  
  55. <P>
  56. <#4146#><FONT SIZE="+1"><#356#><B>make-contact Function, contact</B><#356#></FONT><#4146#>
  57. <A ID="357"><tex2html_anchor_invisible_mark></A>
  58. <A ID="358"><tex2html_anchor_invisible_mark></A>
  59. <DIV class="RIGHT">
  60. <tex2html_image_mark>#tex2html_wrap_inline9669#
  61. </DIV>
  62.  
  63. <P>
  64. <DIV class="RIGHT">
  65. <tex2html_image_mark>#tex2html_wrap_inline9670#</DIV>
  66. <P>
  67. <DIV class="RIGHT"><tex2html_image_mark>#tex2html_wrap_inline9671#</DIV>
  68. <P>
  69. <DIV class="RIGHT"><tex2html_image_mark>#tex2html_wrap_inline9672#</DIV>
  70. <P>
  71. <DIV class="RIGHT"><tex2html_image_mark>#tex2html_wrap_inline9673# 
  72. </DIV>
  73. <P>
  74. <DIV class="RIGHT"><tex2html_image_mark>#tex2html_wrap_inline9674#</DIV>
  75. <P>
  76. <DIV class="RIGHT"><tex2html_image_mark>#tex2html_wrap_inline9675#
  77. </DIV>
  78.  
  79. <P>
  80.  
  81.  =0 <#4906#>=0 <#4910#>